package com.xingzhe.pengji.security.controller.ajax;

import org.directwebremoting.annotations.Param;
import org.directwebremoting.annotations.RemoteMethod;
import org.directwebremoting.annotations.RemoteProxy;
import org.directwebremoting.spring.SpringCreator;
import org.springframework.beans.factory.annotation.Autowired;

import com.xingzhe.pengji.security.domain.Group;
import com.xingzhe.pengji.security.services.GroupService;

/**
 * @Title ： 三江学院 毕业设计
 * @Description ：GroupControlAjax 异步加载
 * @author ：LuFengLiang
 * @Company: IT行者工作室
 * @Copyright: Copyright (c) 2012-3-3
 * @version ： 1.0
 */
@RemoteProxy(creator=SpringCreator.class,creatorParams = @Param(name = "beanName", value = "groupConAjax"))
public class GroupControllerAjax<T extends Group> {
	@Autowired
	private GroupService<T> groupService;
	
	@RemoteMethod
    public String judjeGroupNameExit(String groupName)
	{
		@SuppressWarnings("unchecked")
		T entity=(T) new Group();
		entity.setName(groupName);
		if(null==groupService.getGroupByName(entity))
			return "true";
		return "false";
	}

}
